import type { Entity, IWorld } from '$lib/ecs';
import { defineSkill, getSkillLevel } from './skill';
import { Agility, getStatLevel } from './stat';

export const Dodge = defineSkill('Dodge');

export const getDodge = (world: IWorld, e: Entity) => {
  // get 
  // get dodging skill
  const skill = getSkillLevel(world, e, Dodge);
  // get status (paralyzed, etc)
  return (1 + skill) * getStatLevel(world, e, Agility);
};
